import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const baiyun_index = r =>require.ensure([], () => r(require('@/page/baiyun_index')), 'baiyun_index');

const login = r => require.ensure([], () => r(require('@/page/login')), 'login');
const manage = r => require.ensure([], () => r(require('@/page/manage')), 'manage');
const home = r => require.ensure([], () => r(require('@/page/home')), 'home');
const addShop = r => require.ensure([], () => r(require('@/page/addShop')), 'addShop');
const addGoods = r => require.ensure([], () => r(require('@/page/addGoods')), 'addGoods');
const userList = r => require.ensure([], () => r(require('@/page/userList')), 'userList');
const shopList = r => require.ensure([], () => r(require('@/page/shopList')), 'shopList');
const foodList = r => require.ensure([], () => r(require('@/page/foodList')), 'foodList');
const orderList = r => require.ensure([], () => r(require('@/page/orderList')), 'orderList');
const adminList = r => require.ensure([], () => r(require('@/page/adminList')), 'adminList');
const visitor = r => require.ensure([], () => r(require('@/page/visitor')), 'visitor');
const newMember = r => require.ensure([], () => r(require('@/page/newMember')), 'newMember');
const uploadImg = r => require.ensure([], () => r(require('@/page/uploadImg')), 'uploadImg');
const vueEdit = r => require.ensure([], () => r(require('@/page/vueEdit')), 'vueEdit');
const adminSet = r => require.ensure([], () => r(require('@/page/adminSet')), 'adminSet');
const sendMessage = r => require.ensure([], () => r(require('@/page/sendMessage')), 'sendMessage');
const explain = r => require.ensure([], () => r(require('@/page/explain')), 'explain');
const yiqi =r => require.ensure([], () => r(require('@/page/yiqi')), 'yiqi');
const detail_manage = r=> require.ensure([], () => r(require('@/page/detail_manage')), 'detail_manage');
const gongshang = r=>require.ensure([], () => r(require('@/page/gongshang')), 'gongshang');
const renwu = r=>require.ensure([], () => r(require('@/page/renwu')), 'renwu');
// const guquan= r=>require.ensure([], () => r(require('@/page/guquan')), 'guquan');
const guquanjieg =r=>require.ensure([], () => r(require('@/page/guquan')), 'guquanjieg');
const qiye = r=>require.ensure([], () => r(require('@/page/qiye')), 'qiye');
const gudongm = r=>require.ensure([], () => r(require('@/page/gudongm')), 'gudongm');
const duiwai_fenx = r=>require.ensure([], () => r(require('@/page/duiwaitouzi')), 'duiwaitouzi');
const dwtzm = r=>require.ensure([], () => r(require('@/page/dwtzm')), 'duiwaitouzi');
const people = r=>require.ensure([], () => r(require('@/page/people')), 'people');
const fenzi = r=>require.ensure([], () => r(require('@/page/fenzi')), 'fenzi');
const change_log = r=>require.ensure([], () => r(require('@/page/change_log')), 'change_log');

//yr
const yr_index = r=>require.ensure([], () => r(require('@/yr_page/manage')), 'yr_index');
const yr_real_index =r=>require.ensure([], () => r(require('@/yr_page/yiqi')), 'yr_real_index');
const yr_real_detail =r=>require.ensure([], () => r(require('@/yr_page/detail')), 'yr_real_detail');
const routes = [
	{
		path: '/',
		component: baiyun_index
	},
    {
      path:"/yr_index",
      component: yr_index,
        name: '',
        children: [//子目录
            {
                path: '',
                component: yr_real_index,
                meta: [],
            },
            {
                path:"/yr_real_detail",
                component:yr_real_detail,

            }
        ]
    },
	{
		path: '/manage',
		component: manage,
		name: '',
		children: [
        {
                path: '',
                component: yiqi,
                meta: [],
        },
        // {
		// 	path: '',
		// 	component: home,
		// 	meta: [],
		// },{
            {
			path: '/addShop',
			component: addShop,
			meta: ['添加数据', '添加商铺'],
		},{
			path: '/addGoods',
			component: addGoods,
			meta: ['添加数据', '添加商品'],
		},{
			path: '/userList',
			component: userList,
			meta: ['数据管理', '用户列表'],
		},{
			path: '/shopList',
			component: shopList,
			meta: ['数据管理', '商家列表'],
		},{
			path: '/foodList',
			component: foodList,
			meta: ['数据管理', '食品列表'],
		},{
			path: '/orderList',
			component: orderList,
			meta: ['数据管理', '订单列表'],
		},{
			path: '/adminList',
			component: adminList,
			meta: ['数据管理', '管理员列表'],
		},{
			path: '/visitor',
			component: visitor,
			meta: ['图表', '用户分布'],
		},{
			path: '/newMember',
			component: newMember,
			meta: ['图表', '用户数据'],
		},{
			path: '/uploadImg',
			component: uploadImg,
			meta: ['文本编辑', 'MarkDown'],
		},{
			path: '/vueEdit',
			component: vueEdit,
			meta: ['编辑', '文本编辑'],
		},{
			path: '/adminSet',
			component: adminSet,
			meta: ['设置', '管理员设置'],
		},{
			path: '/sendMessage',
			component: sendMessage,
			meta: ['设置', '发送通知'],
		},{
			path: '/explain',
			component: explain,
			meta: ['说明', '说明'],
		}]
	},
    {
        path: '/detail_manage',
        component: detail_manage,
        name: '',
        children: [
            {
                path: '/',
                component: gongshang,
                meta: [],
            },
            {
                path: '/renwu',
                component: renwu,
                meta: [],
            },
            {
                path:"/guquanjieg",
                component:guquanjieg
            },
            // {
            //     path:"/guquanjieg",
            //     component:guquanjieg
            // },
            {
                path:"/qiye",
                component:qiye
            },
            // {
            //     paht:"/gudongm",
            //     component:gudongm
            // },
            {
                path:"/gudongm",
                component:gudongm
            },
            {
                path:"/duiwai_fenx",
                component:duiwai_fenx
            },
            {
                path:"/dwtzm",
                component:dwtzm
            },{
                path:"/people",
                component:people
            },
            {
                path:"/fenzi",
                component:fenzi
            },
            {
                path:"/change_log",
                component:change_log
            }
        ]
    }
]

export default new Router({
	routes,
	strict: process.env.NODE_ENV !== 'production',
})
